package org.yenn.pattern.aliyun.behavioral.template;

import org.junit.Test;

import static org.junit.Assert.*;

/**
 * 步骤 3
 * 使用 Game 的模板方法 play() 来演示游戏的定义方式。
 */
public class TemplatePatternDemo {

    /**
     * 步骤 4
     * 验证输出。
     *
     * Cricket Game Initialized! Start playing.
     * Cricket Game Started. Enjoy the game!
     * Cricket Game Finished!
     *
     * Football Game Initialized! Start playing.
     * Football Game Started. Enjoy the game!
     * Football Game Finished!
     */
    @Test
    public void play() {
        Game game = new Cricket();
        game.play();
        System.out.println();
        game = new Football();
        game.play();
    }
}